<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="美国,欧美,游戏专线独享EB,socks5代理IP,proxy"/>
<meta name="description" content="socks5自由在线提取系统，出售包日EB，S5代理，包月独享专线，保证独享专线一个IP一个人使用，大量proxy" />
<title>无标题文档</title>
<style type="text/css">
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}

.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}

.STYLE6 {
	color: #000000;
	font-size: 14px;
}

.STYLE10 {
	color: #000000;
	font-size: 12px;
}

.STYLE19 {
	color: #344b50;
	font-size: 12px;
}

.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}

.STYLE22 {
	font-size: 12px;
	color: #295568;
}

.buylink{
	text-decoration: none;
	color: #000000;
}

.up{}

input.error { border: 1px solid red; }
</style>
<script type="text/javascript" src="<%=path%>/js/jquery-1.4.3.js"></script>
<script type="text/javascript" src="<%=path%>/js/jquery.validate.js"></script>
<script type="text/javascript" src="<%=path%>/admin/js/user.js"></script>
<script type="text/javascript">
	function pagebuy(o){
		var no = $('#pageNo').val();
		var reg =/^[0-9]+$/ig;
		if(reg.test(no)){
			if(no>o||no<1){
				alert("输入正确的页码！");
				return false;
			}
			return true;
		}
		return false;
	}
	function show(){document.getElementById("addDiv").style.display="";}

	function validForm() {
		document.getElementById("msg").innerHTML = "";
		var username = document.getElementById("name").value;
		var pwd = document.getElementById("pwd").value;
		var email = document.getElementById("email").value;
		var qq = document.getElementById("qq").value;
		if(username !="" && pwd != "" && email != "" && qq != "") {
			 var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
			 if(!myreg.test(email)){
				 alert('提示\n\n请输入有效的E_mail！');
				 myreg.focus();
				return;
			}
			document.getElementById("addUser").submit();
		} else {
			
			document.getElementById("msg").innerHTML = "信息不能为空";
		}
	}

	function delAdmin(uid) {
		if(confirm("确定要删除该用户么?")) {
			document.getElementById("delForm"+uid).submit();
		}
		
	}
</script>
</head>

<body>
	<table width="100%" border="0" align="center" cellpadding="0"
		cellspacing="0">
		<tr>
			<td height="30"><table width="100%" border="0" cellspacing="0"
					cellpadding="0">
					<tr>
						<td height="24" bgcolor="#353c44"><table width="100%"
								border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td><table width="100%" border="0" cellspacing="0"
											cellpadding="0">
											<tr>
												<td height="19" valign="bottom"><img
													src="<%=path%>/images/tb.gif" width="14" height="14" /><span
													style="vertical-align: middle;" class="STYLE1">
														用户列表</span></td>
												<td valign="bottom"></td>
											</tr>
										</table></td>
									<td>&nbsp;</td>
								</tr>
							</table></td>
					</tr>
				</table></td>
		</tr>
		<tr>
			<td bgcolor="d3eaef" height="34px">
				<form action="<%=path%>/admin/mgruser!show.do" method="post">
					<table border="0px">
						<tr>
							<%-- <td width="4%" align="right">Type:&nbsp;</td>
							<td width="12%" style="color: #EEEEFF;"><s:select list="types" name="type"  headerKey="" headerValue="--All--" id="type" cssStyle="width:100px;"/></td>
							<td width="4%" align="right">Country:&nbsp;</td>
							<td width="12%" style="color: #EEEEFF;"><s:select list="countries" name="country"  headerKey="" headerValue="--All--" id="country" cssStyle="width:100px;"/></td>
							<td width="24%">Region:&nbsp;
								<select id="region" name="region" style="width:100px">
									 <option value="">--All--</option>
								</select>
							</td> --%>
							<td>用户名:&nbsp;
								<input type="text" name="username" width="100px">
							</td>
							<td style="color: #EEEEFF;"><input type="submit"
								value="查找"   style="border:0px; background-color:#EEE;width: 100px;"/></td>
							<td style="color: #EEEEFF;"><input type="button"
								value="新增管理员"  onclick="show();" style="border:0px; background-color:#EEE;width: 100px;"/></td>
							<td><span style="color:red"><s:property value="message"/></span></td>
						</tr>
					</table>
				</form>
			</td>
		</tr>
		<tr>
			<td>
			<div id="addDiv" style="display:none">
				<form id="addUser" action="<%=path%>/admin/mgruser!addAdmin.do" method="post">
				<table>
					<tr>
						<td>帐号:<input id="name" name="user.username" />&nbsp;|</td>
						<td>密码:<input id="pwd" type="password" name="user.password" />&nbsp;|</td>
						<td>邮箱:<input id="email" name="user.email"/>&nbsp;|</td>
						<td>QQ:<input id="qq" name="user.qq"/>&nbsp;|</td>
						<td><input type="button" value="保存" style="border:0px; background-color:#EEE;width: 70px;" onclick="validForm();"/>&nbsp;|</td>
						<td><input type="reset"" value="重置" style="border:0px; background-color:#EEE;width: 70px;"></td>
						<td><span id="msg" style="color:red"></span></td>
					</tr>
				</table>
				</form>
			</div>
			</td>
		</tr>

		<tr>
			<td><table width="100%" border="0" cellpadding="0"
					cellspacing="1" bgcolor="#a8c7ce">
					<tr>
						<td width="4%" height="20" bgcolor="d3eaef" class="STYLE10"><div
								align="center">
								<span class="STYLE10">No.</span>
							</div></td>
						<td width="12%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">用户名</span>
							</div></td>
						<td width="22%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">身　份</span>
							</div></td>
						<td width="14%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">邮　箱</span>
							</div></td>
						<td width="14%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">QQ</span>
							</div></td>
						<td width="14%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">Operate(修改)</span>
							</div></td>
						<td width="14%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">Operate(删除)</span>
							</div></td>
					</tr>
					<tbody>
						<s:iterator value="page.result" var="user" status="s">
							<tr>
								<td height="20" bgcolor="#FFFFFF">
									<input type="hidden" value="<s:property value="#user.id" />">
									<div align="center">
										<s:property value="#s.count"/>
									</div>
								</td>
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">
										<span class="STYLE19" id="spun<s:property value="#user.id" />"><s:property value="#user.username" /></span>
									</div></td>
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">
										<s:if test="#user.state==2">
										<span class="STYLE19" style="color:red">
											管理员
										</span>
										</s:if>
										<s:else>
										<span class="STYLE19">
											普通用户
										</span>
										</s:else>
									</div></td>
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">
											<span class="STYLE19" id="spem<s:property value="#user.id" />"><s:property value="#user.email"/></span>
									</div></td>
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">
										<span class="STYLE19" id="spqq<s:property value="#user.id" />"><s:property value="#user.qq"/> </span>
									</div></td>
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">
										<input type="button" value="修改"  class='up' style="border: 0px;background-color: d3eaef;width: 100px;"/>
									</div></td>
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">
										<form id="delForm<s:property value="#user.id" />" action="<%=path%>/admin/delAdmin.do">
											<input type="hidden" name="user.id" value="<s:property value="#user.id" />">
											<input onclick="delAdmin(<s:property value="#user.id" />)" type="button" value="删除" style="border: 0px;background-color: d3eaef;width: 100px;"/>
										</form>
									</div></td>
							</tr>
						</s:iterator>
					</tbody>
				</table></td>
		</tr>
		<tr>
			<td height="30"><table width="100%" border="0" cellspacing="0"
					cellpadding="0">
					<tr bgcolor="d3eaef">
						<td width="33%"><div align="left">
								<span class="STYLE22">&nbsp;&nbsp;&nbsp;&nbsp;Total:
								<strong> <s:property value="page.totalCount" /></strong> page  
								<strong><s:property value="page.currentPageNo" /></strong> of&nbsp;   
								<strong> <s:property value="page.lastPageNo" /> </strong> PageSize:
								<strong><s:property value="pageSize" /></strong>
								</span>
							</div></td>
						<td width="67%">
							<table width="312" border="0" align="right" cellpadding="0"
								cellspacing="0">
								<tr>
									<s:if test="1==page.currentPageNo">
										<td width="49" align="center">
												<input style="border-color: #EEEEFF; border: 0px;"
													type="button" disabled="disabled" value="First" />
											</td>
									</s:if>
									<s:else>
										<td width="49" align="center">
												<a href="<%=path%>/admin/mgruser!show.do?pageNo=1"><input
													style="border-color: #EEEEFF; border: 0px;" type="button"
													value="First" /></a>
											</td>
									</s:else>
									<s:if test="page.hasPrevPage()">
										<td width="49" align="center">
												<a
													href="<%=path%>/admin/mgruser!show.do?pageNo=<s:property value="pageNo-1"/>"><input
													style="border-color: #EEEEFF; border: 0px;" type="button"
													value="Prev" /></a>
											</td>
									</s:if>
									<s:else>
										<td width="49" align="center">
												<input style="border-color: #EEEEFF; border: 0px;"
													type="button" disabled="disabled" value="Prev" />
											</td>
									</s:else>
									<s:if test="page.hasNextPage()">
										<td width="49" align="center">
												<a href="<%=path%>/admin/mgruser!show.do?pageNo=<s:property value="page.lastPageNo"/>"><input
													style="border-color: #EEEEFF; border: 0px;" type="button"
													value="Next" /></a>
											</td>
									</s:if>
									<s:else>
										<td width="49" align="center">
												<input style="border-color: #EEEEFF; border: 0px;"
													type="button" disabled="disabled" value="Next" />
										</td>
									</s:else>
									<s:if test="page.currentPageNo==page.lastPageNo||page.lastPageNo==0">
										<td width="49" align="center">
												<input style="border-color: #EEEEFF; border: 0px;"
													type="button" disabled="disabled" value="Last" />
										</td>
									</s:if>
									<s:else>
										<td width="49" align="center">
												<a href="<%=path%>/admin/mgruser!show.do?pageNo=<s:property value="page.lastPageNo"/>"><input
													style="border-color: #EEEEFF; border: 0px;" type="button"
													value="Last" /></a>
										</td>
									</s:else>
									<td width="37" class="STYLE22"><div align="center">Go</div></td>
									<td colspan="3" width="97">
										<form action="<%=path%>/admin/mgruser!show.do" method="post">
											<table>
												<tr>
													<td align="center">
															<input type="text" name="pageNo" id="pageNo"
																style="width: 20px; height: 12px; font-size: 12px; border: solid 1px #7aaebd;" />
													</td>
													<td width="22" class="STYLE22"><div align="center">&nbsp;page</div></td>
													<td width="35"><input type="submit" value="Go" style="border-color:#EEEEFF; border: 0px; margin-right: 10px;" onclick="return pagebuy(<s:property value="page.lastPageNo"/>)"></td>
												</tr>
											</table>
										</form>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table></td>
		</tr>
	</table>
</body>
</html>
